home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 June / 1984-06.d64 / 3-d tac toe_vic (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  128 lines

  1. 100 print"[147]":poke36879,15:dimp(27)
  2. 110 dimdi(28):fori=1to27:readx1:x2=x2+x1:di(i+1)=x2:nexti:di(1)=0
  3. 120 dd=37154:p1=37151:p2=37152
  4. 130 print"   [169]     [146]       [223]"
  5. 140 print"  [169]       [146]       [223]"
  6. 150 print" [169]        [146]        [223]"
  7. 160 print"[169]         [146]         [223]"
  8. 170 print"          [146]          [223]"
  9. 180 print"  [146][169]  [169]    [146]     [146]      "
  10. 190 print"    [169]     [146]     [146]      "
  11. 200 print"   [169]      [146]     [146]      "
  12. 210 print"          [146]     [146]      "
  13. 220 print"          [146]     [146]      "
  14. 230 print"  [169]       [146]     [146]      "
  15. 240 print" [169]        [146]           "
  16. 250 print"[169]        [146][169]           "
  17. 260 print"        [146][169]            "
  18. 270 print"       [146][169]   [223]        [146][169]"
  19. 280 print"[223]     [146][169]     [223]      [146][169]"
  20. 290 print"[159]t i c [195] [159]t a c [195][159] t o e"
  21. 300 printtab(2)"[150]firebutton to play"
  22. 310 pokedd,255:p=peek(p1):if -((pand32)=0)<>1 then 310
  23. 320 print"[147][153]";:poke36879,10:o=1
  24. 325 h=256*peek(648):ph=30720:ifpeek(648)=16thenph=33792
  25. 330 cu=32:cc=0:s=36874:vo=36878
  26. 340 pokes+13,240
  27. 350 p(1)=31+h:p(2)=34+h:p(3)=37+h:p(4)=77+h:p(5)=80+h:p(6)=83+h:p(7)=123+h
  28. 360 p(8)=126+h:p(9)=129+h:p(10)=207+h
  29. 370 p(11)=210+h:p(12)=213+h:p(13)=253+h:p(14)=256+h:p(15)=259+h
  30. 380 p(16)=299+h:p(17)=302+h:p(18)=305+h:p(19)=383+h:p(20)=386+h:p(21)=389+h
  31. 390 p(22)=429+h:p(23)=432+h:p(24)=435+h:p(25)=475+h:p(26)=478+h:p(27)=481+h
  32. 400 ford=1to2:print"player #";d;:inputpl$(d):next:co(1)=4:co(2)=5
  33. 410 forv=1to2:pl$(v)=left$(pl$(v),8):next
  34. 420 m(2)=87:m(1)=86:l=1
  35. 430 input"how many rounds";rd
  36. 450 print"[147]";:forv=1to3
  37. 460 print"       [164][164][164][164][164][164][164][164][164]"
  38. 470 printtab(6)"[223][146]  [205]  [205]  [205]"
  39. 480 printtab(6)"[223][223][146][164] [205][164] [205][164] [205]"
  40. 490 printtab(7)"[223][223][146][163][163][205][163][163][205][163][163][205]"
  41. 500 printtab(8)"[223][223][146][164] [205][164] [205][164] [205]"
  42. 510 printtab(9)"[223][223][146][163][163][205][163][163][205][163][163][205]"
  43. 520 printtab(10)"[223][223][146]  [205]  [205]  [205]"
  44. 530 printtab(11)"[223]         [146]";
  45. 540 onvgoto550,560,570
  46. 550 print"";:next
  47. 560 print"";:next
  48. 570 r=1
  49. 580 pokep(o),160:pokep(o)+ph,2
  50. 590 print"[158]round:[153]";r
  51. 600 print"";:forv=1to11:print" ";:nextv
  52. 605 print"":printpl$(l);"'s":print"turn"
  53. 610 pokedd,127:p=peek(p2)and128:j1=-(p=0)
  54. 620 pokedd,255:p=peek(p1):j2=-((pand16)=0)
  55. 630 ifj1=1thenpp=1:goto660
  56. 640 ifj2=1thenpp=-1:goto680
  57. 650 goto760
  58. 660 ifo=27theno=26:nx=cu:nc=cc:goto710
  59. 670 nx=peek(p(o+1)):nc=peek(p(o+1)+ph):goto700
  60. 680 ifo=1theno=2:nx=cu:nc=cc:goto710
  61. 690 nx=peek(p(o-1)):nc=peek(p(o-1)+ph)
  62. 700 pokep(o),cu:pokep(o)+ph,cc
  63. 710 o=o+pp
  64. 720 cu=nx:cc=nc
  65. 730 pokep(o),160:pokep(o)+ph,1
  66. 740 pokevo,15:pokes,170
  67. 750 ford=1to20:next:pokevo,0:goto770
  68. 760 ford=1to15:next
  69. 770 pokep(o),cu:pokep(o)+ph,cc:ford=1to45:next:pokep(o),160:pokep(o)+ph,1
  70. 780 pokedd,255:p=peek(p1):j= -((pand32)=0):ifj<>1then610
  71. 790 ifcu=32then820
  72. 800 pokevo,15:pokes,160
  73. 810 ford=1to500:next:pokevo,0:goto610
  74. 820 pokep(o),m(l):pokep(o)+ph,co(l):cu=m(l):cc=co(l)
  75. 830 pokevo,15:pokes,200
  76. 840 ford=1to250:next:pokevo,0
  77. 850 a=0:b=0:c=0
  78. 860 restore:readx:for i=1todi(o)+13:readx,y:nexti
  79. 870 fori=di(o)+1todi(o+1)
  80. 880 read x,y:if(peek(p(x))=m(l))and(peek(p(y))=m(l))then b=x:c=y:a=o
  81. 890 nexti
  82. 900 ifa=0then1010
  83. 910 print"          "
  84. 920 print"";pl$(l):print"wins!";
  85. 930 sc(l)=sc(l)+1
  86. 940 t=255:pokevo,15:pokes,133::forx=1to10
  87. 950 h=int(16*rnd(1))
  88. 960 pokep(a)+ph,h
  89. 970 pokep(b)+ph,h
  90. 980 pokep(c)+ph,h
  91. 990 pokes,t:ford=1to350:next:t=t-26:next:pokes,160:pokevo,0:goto1000
  92. 1000 foro=1to27:pokep(o),32:pokep(o)+ph,0:next
  93. 1010 ifl=1thenl=2:goto1030
  94. 1020 l=1
  95. 1030 ifa=0then590
  96. 1040 cu=32:cc=0:nx=0:nc=0:o=1
  97. 1050 r=r+1:ifr>rdthen1070
  98. 1060 print"           ":print"     ":goto590
  99. 1070 print"[147]                 "
  100. 1080 print"final score"
  101. 1090 print"[158][183][183][183][183][183][183][183][183][183][183][183]"
  102. 1100 printpl$(1);":";sc(1)
  103. 1110 printpl$(2);":";sc(2)
  104. 1120 print"firebutton to play    again,(e) to end"
  105. 1125 pokedd,255:p=peek(p1)
  106. 1128 get xx$:if xx$="e" then end
  107. 1129 if -((pand32)=0)<>1 then 1125
  108. 1130 poke198,0:run
  109. 1140 data 7,4,7,4,5,4,7,4,7,4,5,4,5,12,5,4,5,4,7,4,7,4,5,4,7,4,7
  110. 1150 data 2,3,4,7,5,9,10,19,13,25,11,21,14,27,1,3,5,8,11,20
  111. 1160 data 14,26,2,1,6,9,5,7,12,21,15,27,14,25,11,19,5,6
  112. 1170 data 14,24,13,22,1,7,1,9,2,8,3,7,4,6,14,23,15,24
  113. 1180 data 3,9,14,22,4,5,1,4,3,5,8,9,16,25,13,19,17,27,14,21
  114. 1190 data 7,9,2,5,17,26,14,20,1,5,3,6,7,8,18,27,15,21,17,25,14,19
  115. 1200 data 11,12,13,16,14,18,1,19,10,12,14,17,2,20,3,19,1,21
  116. 1210 data 14,16,15,18,10,11,3,21,10,16,14,15
  117. 1220 data 4,22,1,25,7,19,10,18,11,17,12,16,13,15,2,26
  118. 1230 data 1,27,3,25,4,24,6,22,7,21,8,20,9,19,12,18
  119. 1240 data 13,14,6,24,3,27,9,21,10,13,18,17,12,14,7,25
  120. 1250 data 11,14,16,18,8,26,9,25,7,27,12,15,10,14,16,17
  121. 1260 data 9,27,20,21,22,25,23,27,1,10,9,14,7,13,3,11
  122. 1270 data 23,26,2,11,8,14,19,21,19,20,27,24,23,25
  123. 1280 data 12,3,9,15,7,14,1,11,19,25,23,24,4,13,6,14
  124. 1290 data 19,27,20,26,21,25,22,24,5,14,22,23,21,27
  125. 1300 data 6,15,4,14,23,21,26,27,19,22,7,16,1,13,9,17
  126. 1310 data 3,14,20,23,25,27,8,17,2,14,19,23,21,24,25,26
  127. 1320 data 9,18,3,15,7,17,1,14
  128.